/*
 * @(#)SpreadSheetType.java $version 2012. 2. 10.
 *
 * Copyright 2007 NHN Corp. All rights Reserved. 
 * NHN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */

package com.board.utils;

import java.util.HashMap;
import java.util.Map;

/**
 * @author uthgar
 */
public enum EnumSample {
	ENCRYPT_ONE_WAY_KEY("DENC001", "ALGORITHM.AES128"), ENCRYPT_TWO_WAY_KEY("DENC002", "ALGORITHM.SHA128");

	private static final Map<String, EnumSample> MAP;

	/**
	 * 암호화 유형
	 */
	private final String dataMaker;

	/**
	 * 암호화 알고리즘
	 */
	private final String algorithm;

	static {
		MAP = new HashMap<String, EnumSample>();

		for (EnumSample encryptKey : values()) {
			MAP.put(encryptKey.dataMaker, encryptKey);
		}
	}

	/**
	 * 코드값에 대응하는 유형을 반환
	 * 
	 * @param code 암호화 유형
	 * @return enum key
	 */
	public static EnumSample fromDataMakerCode(String code) {
		return MAP.get(code);
	}

	private EnumSample(String dataMaker, String algorithm) {
		this.dataMaker = dataMaker;
		this.algorithm = algorithm;
	}

	public String getDataMaker() {
		return dataMaker;
	}

	public String getAlgorithm() {
		return algorithm;
	}

}